package com.mysoft.gfyx.marketdevelop.controller;

import com.mysoft.framework.rpc.annotation.PubAction;
import com.mysoft.framework.rpc.annotation.PubService;
import com.mysoft.framework.rpc.contants.RequestPrefix;
import com.mysoft.gfyx.common.rpc.opptyservice.dto.*;
import com.mysoft.gfyx.marketdevelop.controller.dto.ContactCooperationListRequestDto;
import com.mysoft.gfyx.marketdevelop.controller.dto.ContactListRequestDto;
import com.mysoft.gfyx.marketdevelop.controller.dto.GetDetailDataRequestDto;
import com.mysoft.gfyx.marketdevelop.service.ContactService;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMethod;

import java.util.List;

@PubService(value = "/contactDataApi", prefix = RequestPrefix.API)
@Tag(name = "联系人-API")
public class ContactDataApiController {

    @Autowired
    private ContactService contactService;

    @PubAction(value = "/getList", method = RequestMethod.POST)
    public Object getContactList(@RequestBody ContactListRequestDto dto) {
        return contactService.getContactList(dto);
    }

    @PubAction(value = "/detail", method = RequestMethod.POST)
    public ContactListResponseDto.ContactList contactDetail(@RequestBody GetDetailDataRequestDto dto) {
        return contactService.contactDetail(dto);
    }

    @PubAction(value = "/getMobile", method = RequestMethod.POST)
    public ContactListResponseDto.ContactList getMobile(@RequestBody GetDetailDataRequestDto dto) {
        return contactService.getMobile(dto);
    }

    @PubAction(value = "/cooperationList", method = RequestMethod.POST)
    public ContactCooperationListResponseDto.CooperationList cooperationList(@RequestBody ContactCooperationListRequestDto dto) {
        return contactService.cooperationList(dto);
    }

    @PubAction(value = "/rpaContact", method = RequestMethod.POST)
    public RpaContactResponseDto.DataList rpaContact(@RequestBody RpaContactRequestDto dto) {
        return contactService.rpaContact(dto);
    }

    @PubAction(value = "/rpaContactMobile", method = RequestMethod.POST)
    public RpaContactResponseDto.ContactList rpaContactMobile(@RequestBody RpaContactMobileRequestDto dto) {
        return contactService.rpaContactMobile(dto).getData();
    }

}
